{% extends "ui/base-devices.html" %}

{% load url from future %}
{% load bob i18n icons %}

{% block contentarea %}
  <div class="row-fluid">
    <div class="span10">
        <div class="alert alert-warning">
            {% trans "Make sure that the <b>Service catalog</b> and <b>Device environment</b> are set to the correct value!" %}
        </div>
        <form class="form form-horizontal device-create-form" method="POST">
            {% csrf_token %}
            {% for d in devices %}
            <input type="hidden" name="select" value="{{ d.id }}">
            {% endfor %}
            {% for f in form.visible_fields %}
            <div class="control-group {{ f.css_classes }}
                {% if f.errors %}error{% endif %}
            ">
                <label class="control-label {% if f.field.required %}required{% endif %}"
                    >{{ f.label }}</label>
                <div class="controls">
                    {{ f }}
                    {% for e in f.errors %}
                        <span class="help-inline">{{ e }}</span>
                    {% empty %}
                    {%  if f.help_text %}
                        <span class="help-inline">{{ f.help_text }}</span>
                    {%  endif %}
                    {% endfor %}
                </div>
            </div>
            {% endfor %}
        <div class="form-actions">
            <div class="control-group" style="white-space:nowrap">
                <button class="btn btn-primary" type="submit" name="save">
                        {% icon 'fugue-tick' %}&nbsp;Save
                </button>
            </div>
        </div>
        </form>
    </div>
    <div class="span2 template-tabs">
      {% tab_menu template_menu_items template_selected side='right' %}
    </div>
  </div>
{% endblock %}
